package com.example.stock.controller;

import com.example.stock.service.MarginTradingService;
import com.example.stock.util.Result;
import com.example.stock.util.ResultGenerator;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@CrossOrigin(origins = "*")
@RequestMapping("marTra")
@RestController
public class MarginTradingController {

    @Autowired
    MarginTradingService marginTradingService;

    @GetMapping
    public Result index() {
        return ResultGenerator.genSuccessResult(marginTradingService.getMarginTradings());
    }
}
